/*
 * Copyright (C) 2023 Coder.AN
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
#include "xbox.h"
#include "xbox_filter.h"


void callback(struct XBoxInputVal val)
{
    xbox_filter(val);
    printf("->X1:%6d Y1:%6d X2:%6d Y2:%6d du:%d dd:%d dl:%d dr:%d A:%d B:%d X:%d Y:%d lt:%6d rt:%6d lb:%d rb:%d back:%d guide:%d start:%d\n", 
        val.X1, val.Y1, val.X2, val.Y2,
        val.du, val.dd, val.dl, val.dr,
        val.A, val.B, val.X, val.Y,
        val.lt, val.rt, val.lb, val.rb,
        val.back, val.guide, val.start);
}

int main()
{
    XBox xbox(callback);
    while (1);
    return 0;
}